﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Domain.Model.Program>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit <%: Model.Name %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Edit <%: Model.Name %></h2>

    <% using (Html.BeginForm("Edit", "Program", FormMethod.Post))
       {%>
        <%: Html.ValidationSummary(true) %>
        <div>
                
            <table>
                        
                <tr>
                    <td>
                            <%: Html.LabelFor(m => m.Name) %>
                    </td>
                    <td>
                        <%: Html.TextBoxFor(m => m.Name)%>
                    </td>
                </tr>

                <tr>
                    <td>
                        <%: Html.LabelFor(m => m.Description)%>
                    </td>
                    <td>
                        <%: Html.TextBoxFor(m => m.Description)%>
                    </td>
                </tr>

            </table>

            <p>
                <%: Html.Hidden("Id", Model.Id) %> 
                <input type="submit" value="Save" />
            </p>

        </div>

    <% } %>

    <p>
        <%: Html.ActionLink("Back to Portfolio", "Index", "Portfolio") %> |  
        <%: Html.ActionLink("Edit", "Edit", "Program", new { id = Model.Id }, null) %> |
        <%: Html.ActionLink("Add Project", "Create", "Project", new { programId = Model.Id}, null) %>
    </p>

    <p>
        Projects within this program
    </p>

    <% Html.RenderPartial("ProjectList", Model.Projects); %>

</asp:Content>

